package com.example.demo.service.impl;

import com.example.demo.entity.BookInfo;
import com.example.demo.mapper.BookInfoMapper;
import com.example.demo.service.BookInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class BookInfoServiceImpl implements BookInfoService {

    @Autowired
    private BookInfoMapper bookInfoMapper;

    @Override
    public List<BookInfo> infoList() {

        BookInfo info = new BookInfo();
        List<BookInfo> list = bookInfoMapper.listBook(info);

        return list;
    }

    @Override
    public void addBook(BookInfo info){

        info.setDeleted(0);
        bookInfoMapper.insert(info);

    }


}
